package cn.wdm.ymcc.service.impl;

import cn.wdm.ymcc.domain.MessageEmail;
import cn.wdm.ymcc.mapper.MessageEmailMapper;
import cn.wdm.ymcc.mq.SendEmailFileProducer;
import cn.wdm.ymcc.service.IMessageEmailService;
import cn.wdm.ymcc.util.AssertUtil;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lao.zhang
 * @since 2022-07-15
 */
@Service
public class MessageEmailServiceImpl extends ServiceImpl<MessageEmailMapper, MessageEmail> implements IMessageEmailService {
    @Autowired
    private SendEmailFileProducer emailFileProducer;
    /**
     * 往mq中发送异步消息
     * @param messageEmail
     */
    @Override
    public Boolean sendEmail(MessageEmail messageEmail) {
        boolean b = emailFileProducer.sendMessage(messageEmail);
        return b;
    }
}
